package main

import (
	"fmt"
	"math/rand"
	"time"
)

type userActionGene struct {
	userName  string
	placeName string
	action    string
	time      time.Time
}

func FunctionOut() {
	var returnValue userActionGene
	var actions []string
	var userName []string
	var placeName []string
	actions = []string{"画画", "拉屎", "唱歌", "洗澡", "打游戏", "遛狗", "玩火", "化妆", "骑摩托", "裸奔", "恰火锅", "抽烟", "收拾行李箱"}
	userName = []string{"小左", "美丽", "雨晨", "加绒", "加加", "小玩具", "妹妹", "路人甲", "老狗", "宋钟基", "权志龙", "劫匪"}
	placeName = []string{"在八达岭长城边", "在遍布狗屎的公厕中", "在家里的空调上", "在克林姆林工里", "在小三家", "在火星上", "在天安门广场", "在湖中"}

	returnValue = userActionGenerate(userName, actions, placeName)
	fmt.Printf("%s%s%s", returnValue.userName, returnValue.placeName, returnValue.action)

}

func userActionGenerate(username []string, actions []string, placeNames []string) userActionGene {

	var action = actions[rand.Intn(len(actions))]
	var placeName = placeNames[rand.Intn(len(placeNames))]
	var userName = username[rand.Intn(len(username))]
	internalstruct := userActionGene{
		userName:  userName,
		action:    action,
		placeName: placeName,
		time:      time.Now(),
	}

	return internalstruct
}
